#ifndef CURLTOOL_H
#define CURLTOOL_H
#include <curl/curl.h>
#include <string>
#include <list>
#include <iostream>
#include <QMutex>

class CurlTool
{
public:
    explicit CurlTool();
    ~CurlTool();
    static CurlTool*  getInstance();
    curl_slist * setBaseInfo( curl_slist *tempHeaders);
    //size_t curlSaveResponseToStdString(void *buffer, size_t size, size_t nmemb, std::string *lpVoid);
    std::string post(const char* url, const char* data, CURLcode *code = NULL);
private:
    static CurlTool* m_curltool;
    CURL* m_curl;
    static QMutex* m_mutex;

};

#endif // CURLTOOL_H
